import { createRouter, createWebHashHistory } from 'vue-router'

import Home from '@/views/Home.vue'
import DeviceEdit from '@/components/DeviceEdit.vue'
import DeviceCtrl from '@/components/DeviceCtrl.vue'
import Login from '@/views/Login.vue'
import FirmUpload from '@/components/FirmUpload.vue'
import Product from '@/components/Product.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      component: Home,
      path: '/',
      children: [
        {
          component: DeviceEdit,
          path: '/edit'
        }, {
          component: DeviceCtrl,
          path: '/ctrl'
        }, {
          component: FirmUpload,
          path: '/firm_upload'
        }, {
          path: '/product',
          component: Product,
        }
      ]
    }, {
      component: Login,
      path: '/login'
    }
  ]
})

export default router
